<!DOCTYPE html>
<html lang="en">
<head>
<title>TFY FOREX</title>
<meta charset="utf-8" />
<meta name="author" content="孙新-xs06974@163.com" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<link rel="stylesheet" href="resources/css/bootstrap.css" />
<link rel="stylesheet" href="resources/css/tfy2.css" />
<link rel="icon" href="/upload/images/logo.ico" type="image/x-icon" />
</head>
<style>
.regform{
	padding: 200px 100px 0 100px;
	min-height: 300px;
}

.regform .inner{
	border: solid rgba(204,204,204, 0.2) 6px;
	border-radius: 5px;
	
}

.regform .inner .inner1{
	background-color: #dfe1e3;
	min-height: 200px;
	text-align: center;
	padding: 30px 0 30px 0;
}

.inner1 span {
	font-size: 30px;
	font-weight: normal;
	color: #333;
}

.inner1 span em{
	color: #ff6200;
}

.formItemWrapper{
	margin: 20px 40px;
	border: solid #aaa 2px;
	border-radius: 3px;
	padding: 10px;
	text-align: left;
	color: #666;
	background-color: #fff;
}

.formItemWrapper input {
	width: 120px;
	border: none;
	outline: none;
}

.formItemWrapper1{
	margin: 20px 20px;
	border: solid #aaa 2px;
	border-radius: 3px;
	padding: 10px;
	text-align: center;
	color: #fff;
	background-color: #ff6200;
	border: none;
	cursor: pointer;
}
</style>
<body>
<div id="sec1">
	<div class="container center" >
		<div class="row">
			<div class="col-xs-6">
				<img src="upload/images/pc/tfy2/logo3.png" />
			</div>
			<div class="col-xs-6" style="text-align: right;">
				<a href="aboutus3.html">关于我们</a>
				<a href="#">在线客服</a>
			</div>
		</div>
	</div>
</div>

<div id="sec21">
	<div class="container">
		<div class="row">
			<div class="col-xs-2">
			</div>
			<div class="col-xs-8">
				<div class="regform">
					<div class="inner">
						<div class="inner1">
							<br />
							<span>免费领取<em>$10,000</em>体验金</span><br />
							<br />
							<div class="formItemWrapper">
							姓名: <input  name="name" id="name" placeholder="您的姓名" />
							</div>
							<div class="formItemWrapper">
							手机: <input  name="mobile" id="mobile" placeholder="您的手机号"  />
							</div>
							<div class="formItemWrapper verifyCode">
							验证码: <input name="code" id="code" placeholder="请输入验证码" />
							<button id="btnGetVerifyCode" class="btn btn-sm btn-primary" style="float: right; vertical-align: middle; margin-top: -2px;">发送验证码</button>
							<!--img id="verifyCodeImage" src="genCaptcha" title="点击刷新验证码" /-->
							</div>
							<div class="formItemWrapper1" id="btnSubmit">
								免费体验
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="col-xs-2">
			</div>
		</div>
	</div>
</div>
<div id="sec7">
	<div class="container center">
		<a href="#">风险提示</a>	
		<a href="#">隐私条款</a>
		<a href="#">免责声明</a>
		<span>Copyright &copy; 2017 TFY Forex Global, All Rights Reserved</span>
	</div>
</div>

</body>
<script src="resources/js/jquery-2.1.4.js"></script>
<script>
$('#btnSubmit').click(function(){
	var name = $('#name').val();
	var mobile = $('#mobile').val();
	var code = $('#code').val();
	
	if(name=='') {
		alert('请输入您的姓名');
		return;
	}
	

	if(mobile=='' || !/\d{11,11}/.test(mobile)) {
		alert('请输入您的手机号码');
		return;
	}
	
	if(code=='') {
		alert('请输入验证码');
		return;
	}
	
	$.ajax({
		url: 'userInfo/add',
		type: 'post',
		data: {'name': name, 'mobile': mobile, 'code': code},
		success: function(data){
			if(data=='BADCODE') {
				alert('验证码错误, 请重新输入');
				return;
			}
			alert('提交成功, 请保持手机畅通, 工作人员会联系您.')
			$('#name').val('');
			$('#mobile').val('');
			$('#code').val('');
		},
		error: function(){
			alert('操作失败, 请稍后重试');
		}
	})
});

$('#verifyCodeImage').click(function(){
	$(this).attr('src', 'genCaptcha?v=' + new Date());
});

$('#btnGetVerifyCode').click(function(){
	var that = $(this);
	var mobile = $('#mobile').val();
	if(mobile=='' || !/\d{11,11}/.test(mobile)) {
		alert('请输入正确的手机号码');
		return;
	}
	
	$.ajax({
		url: 'sendVerifyCode?mobile=' + mobile,
		success: function() {
			$(that).attr('disabled', true);
			var count = 59;
			var timer = setInterval(function(){
				$(that).text(count);
				count--;
				if(count<=0) {
					$(that).attr('disabled', false);
					$(that).text('发送验证码');
					clearInterval(timer);
				}
			}, 1000)
		},
		error: function(){
			alert('获取验证码失败, 请稍后重试');
		}
	})
});


$('.formItemWrapper').click(function(){
	$(this).find('input').focus();
});

</script>
<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?62f3c3ef3b75268eb64da8b728220266";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>
</html>

